package com.wsc.wisdomchinaqinghe.activitity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.wsc.wisdomchinaqinghe.R;
import com.wsc.wisdomchinaqinghe.activitity.baseactivity.BaseActivity;

/**
 * 生活缴费
 */
public class LivingExpensesActivity extends BaseActivity implements View.OnClickListener{

    private TextView fragment_lyhd_title;//标题
    private ImageView fragment_lyhd_back;//返回按钮
    private Context context;
    private String nametitle;
    private RelativeLayout layout_water;
    private RelativeLayout layout_dian;
    private RelativeLayout layout_meiqifei;
    private String cidNumber;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.liveexpense_layout);
        context=this;
        Intent intent=getIntent();
        nametitle=intent.getStringExtra("name");
        cidNumber=intent.getStringExtra("cid");
        initView();
    }

    private void initView() {
        fragment_lyhd_title=(TextView) findViewById(R.id.tv_headtitle);//标题
        fragment_lyhd_back=(ImageView) findViewById(R.id.regist_back);//返回按钮
        fragment_lyhd_back.setOnClickListener(this);
        fragment_lyhd_title.setText(nametitle);
        layout_water=(RelativeLayout) findViewById(R.id.layout_water);
        layout_water.setOnClickListener(this);
        layout_dian=(RelativeLayout) findViewById(R.id.layout_dian);
        layout_dian.setOnClickListener(this);
        layout_meiqifei=(RelativeLayout) findViewById(R.id.layout_meiqifei);
        layout_meiqifei.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId())
        {
            case R.id.regist_back:
                finish();
                break;
            //水费
            case R.id.layout_water:
                Intent intent=new Intent(context,LivingExpensesListActivity.class);
                intent.putExtra("cid",cidNumber);
                intent.putExtra("projectId","c2670");
                startActivity(intent);
                break;
            //电费
            case R.id.layout_dian:
                Intent intentdian=new Intent(context,LivingExpensesListActivity.class);
                intentdian.putExtra("cid",cidNumber);
                intentdian.putExtra("projectId","c2680");
                startActivity(intentdian);
                break;
            //煤气费
            case R.id.layout_meiqifei:
                Intent intentran=new Intent(context,LivingExpensesListActivity.class);
                intentran.putExtra("cid",cidNumber);
                intentran.putExtra("projectId","c2681");
                startActivity(intentran);
                break;
        }
    }

}
